<template>
	<view>
		<view class="header">
			<u-dropdown menu-icon="arrow-down-fill" menu-icon-size="12" title-size="24" active-color="#3458A2"
				height="100" :border-bottom="true">
				<u-dropdown-item v-for="(c,i) in list" :key="i" :title="c.time" :options="c.options">
				</u-dropdown-item>
			</u-dropdown>
		</view>

		<view class="footer-list-s-center">
			<view class="charts-box">
				<qiun-data-charts type="mix" :chartData="index.S2021622S" :errorShow="false" :echartsApp="true"
					:inScrollView="true" :disableScroll="true" background="none" :opts="index.s20216212" />
				<!-- chartDatas -->
				<!-- listsd -->

			</view>
		</view>

		<view class="footer-footer">

			<view class="footer-footer-header">
				<view>存贷比趋势明细表</view>
				<view>（单位：亿元）</view>

				<view>
					<i class="el-icon-crop"></i>
				</view>

			</view>
		</view>



		<view class="footeraaaaaaaaaaa">
			<el-table :data="tableData" :cell-style="cellStyle" :header-cell-style="tableHeaderColor">
				<el-table-column prop="DAY" label="" width="100">
				</el-table-column>
				<el-table-column prop="PERSENT" label="地区整体存贷比" width="120">
				</el-table-column>
				<el-table-column prop="BANK4.FK_BALANCE_VALUE" width="120" label="中行">
				</el-table-column>
				<el-table-column prop="BANK3.FK_BALANCE_VALUE" width="120" label="农行">
				</el-table-column>
				<el-table-column prop="BANK2.FK_BALANCE_VALUE" width="120" label="建行">
				</el-table-column>
				<el-table-column prop="BANK1.FK_BALANCE_VALUE" width="120" label="工行">
				</el-table-column>
			</el-table>

		</view>

	</view>






</template>

<script>
	import {
		arealdrtrend
	} from '../../../network/page/GroupO.js'
	import table from './zs.js'
	import index from '../echarts/index.js'
	export default {
		data() {
			return {
				list: [{
						time: "起止时间",
						fel: false,
						options: []
					},
					{
						time: "存款余额口径",
						fel: false,
						options: []
					},
					{
						time: "贷款余额口径",
						fel: false,
						options: []
					},
					{
						time: "地区",
						fel: false,
						options: []
					}
				],
				index: index,
				tableData: [],
				table: table
			};
		},
		mounted() {
			arealdrtrend({
				depositCAL: 'TOTA_B',
				loanCAL: 'FK_B',
				mortgageCAL: 'AJ_B',
				area: '香港',
				startTime: '2020-02-01',
				endTime: '2020-08-20',
				LDRCAL: '1'

			}).then(res => {
				console.log(res.data.data.list)
				let stingList = []
				res.data.data.list.forEach(res => {
					let stingL = `${res.BANK.split('')[0]}${res.BANK.split('')[1]}`
					if (stingL == '中国' || stingL == "农业" || stingL == "工商" || stingL == "建设") {
						stingList.push(res)

					}
				})
				let i = 0
				let listtds = []
				let liststingd = []
				stingList.forEach(res => {
					i++

					if (i == 5) {
						liststingd.push(listtds)
						listtds = []
						i = 1
					}
					listtds.push(res)



				})
				let lll = []
				liststingd.forEach(res => {
					let indexs = [];
					res.forEach((index, item) => {
						indexs.push(index.DAY)
						indexs.push(index.BANK)
						indexs.push(index.FK_BALANCE_VALUE)
						indexs.push(index.PERSENT)

						let Folists = {
							DAY: indexs[0],
							BANK1: {
								BANK: indexs[1],
								FK_BALANCE_VALUE:  (indexs[2]/100000000).toFixed(2),
							},
							BANK2: {
								BANK: indexs[5],
								FK_BALANCE_VALUE: (indexs[6]/100000000).toFixed(2),
							},
							BANK3: {
								BANK: indexs[9],
								FK_BALANCE_VALUE: (indexs[10]/100000000).toFixed(2),
							},
							BANK4: {
								BANK: indexs[13],
								FK_BALANCE_VALUE: (indexs[14]/100000000).toFixed(2),
							},
							PERSENT: indexs[15]

						}

                               lll.push(Folists)

						// lll.push(indexs)



					})
				})
				
				var noPassive=[]
lll.forEach(res=>{
	if(res.PERSENT==0){
		noPassive.push(res)
	}
})

this.tableData=noPassive
				







				let daymonth = []
				let rjcdb = []
				let rjckye = []
				let rjdkye = []
				// daymonth: "2021-02-04"  时间
				// rjcdb: 0   折线
				// rjckye: 0   左图
				// rjdkye: 9.08 右图 
				res.data.data.listechartsnew.forEach(res => {
					daymonth.push(res.daymonth)
					rjcdb.push(res.rjcdb)
					rjckye.push(res.rjckye)
					rjdkye.push(res.rjdkye)
				})
				console.log(daymonth, rjcdb, rjckye, rjdkye)
				this.index.S2021622S.categories = daymonth
				this.index.S2021622S.series[0].data = rjckye
				this.index.S2021622S.series[1].data = rjdkye
				this.index.S2021622S.series[2].data = rjcdb

			})




		},
		methods: {
			cellStyle(row, column, rowIndex, columnIndex) {
				return 'background:#F7F7F7'
			},
			tableHeaderColor(row) {
				return 'background:#F7F7F7'
			},
		}
	}
</script>

<style scoped src="../../css/css1-10/sanAllcss/sanAllcss.min.css">
</style>
<style scoped src="../../css/cssall/s.min.css"></style>

<style lang="scss" scoped>
	.charts-box{
		padding:  0 5upx !important;
	}

</style>
